The present invention relates generally to software execution in a multi-user computing environment and in particular to improving the operation of Just-in-Time (JIT) compilation of cloud-based applications.
In computer science, a conventional programming-language compiler compiles source code into an executable computer program or program “runtime.” Instances of the executable program may then be launched in compatible computing environments, and each launched instance consumes an amount of computer memory.
A Just-in-Time Translator is a special type of compiler that only partially compiles code into an intermediate form sometimes referred to as “bytecode” or “p-code.” JIT compilation completes when an instance of the program is launched, at “runtime.” At actual runtime, when the program is to be run by a user, the intermediate code is translated into computer-executable machine code on the fly.
JIT compilation and subsequent translation may be more efficient at the time of initial bytecode compilation because the initial compilation defers the time-consuming process of full compilation to executable code until runtime. JIT compilation may also reduce the amount of required disk space because the intermediate bytecode form of an application is generally smaller than its corresponding fully compiled executable.
But JIT translation also requires greater computational resources and may reduce performance at runtime because a JIT translator must perform time-consuming translation tasks at runtime. In addition to interactively translating intermediate bytecode into machine language that is specific to a particular computing environment, JIT translation may also comprise loading large runtime modules from libraries in order to generate an executable program capable of being run in a particular computing environment.
For example, launching a JIT-compiled application a user environment based on the .NET framework may comprise translating a previously compiled bytecode version of the application into an executable that comprises .NET runtime libraries and launching the application on an open-source HHVM (HipHop Virtual Machine) platform may comprise translating same the bytecode into an executable that comprises PHP library routines. Similarly, launching the application on a Pypy platform may comprise translating the bytecode into an executable program that comprises Python runtime-library modules.
Furthermore, JIT compilation may not reduce the amount of memory required to run multiple instances of a compiled program. If two instances of a JIT-compiled program (each running in either the same or in different containers, dedicated user-specific operating environments, or virtual machines) run similar workloads and are compiled with the same libraries, both instances will at runtime be translated into the same native assembly code and will thus consume the same amount of memory.
Similarly, if a third instance then launches, that new instance will require its own copy of the executable program, even if a similar JIT-translated instance has already been provisioned in the same environment. Therefore, regardless of whether a program is compiled by a conventional compiler or by a JIT compiler, launching five instances of the program, even in the same operating environment, may consume five times the memory required by a single instance. Furthermore, in such a case, JIT translation would require five resource-intensive JITT translation tasks to be run concurrently.